package cn.itcast.bos.mq;

import javax.jms.MapMessage;
import javax.jms.Message;
import javax.jms.MessageListener;

import org.springframework.stereotype.Service;

import cn.itcast.bos.utils.AlyunUtils;




@Service("smsConsumer")
public class smsConsumer implements MessageListener {

	@Override
	public void onMessage(Message message) {
		MapMessage mapMessage =  (MapMessage) message;
		//调用Sms服务发送短信
		try {
			String telephone = mapMessage.getString("telephone");
			String randomCode = mapMessage.getString("randomCode");
		//	AlyunUtils.sendSms(telephone, randomCode);
	
		} catch (Exception e) {
			e.printStackTrace();
		}
	
	
		
	}

}
